﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media.Imaging;

namespace KeyboardImageViewer
{
    public class ImageSummary
    {
        public ImageSummary()
        {
            this.Id = -1;
        }

        public int Id { get; set; }

        public bool Ineligible { get; set; }

        public string HashPrefix { get; set; }

        public DateTime LastRefreshDate { get; set; }

        public double AverageVariance { get; set; }

        public double FractionDrasticPixelBorders { get; set; }

        // RGB, left-to-right, top to bottom.
        public byte[] Thumbnail { get; set; }

        public byte this[int x, int y, int colorIndex]
        {
            get
            {
                return this.Thumbnail[(y * DuplicateUtils.MetaPixelsPerSide + x) * 3 + colorIndex];
            }
            set
            {
                this.Thumbnail[(y * DuplicateUtils.MetaPixelsPerSide + x) * 3 + colorIndex] = value;
            }
        }

        public byte this[int location]
        {
            get
            {
                return this.Thumbnail[location];
            }
            set
            {
                this.Thumbnail[location] = value;
            }
        }
    }
}
